<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>set_base - ClueLib</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="set_base"></a>set_base</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual class set_base #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends collection#( T )</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Defines the core functionality of a <a href="cl_set-svh.html#set" class=LClass id=link5 onMouseOver="ShowTip(event, 'tt2', 'link5')" onMouseOut="HideTip('tt2')">set</a>.</p><h4 class=CHeading>Parameter</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>T</td><td class=CDLDescription><span class="optional">optional</span> The type of data collected in a <a href="cl_set-svh.html#set" class=LClass id=link6 onMouseOver="ShowTip(event, 'tt2', 'link6')" onMouseOut="HideTip('tt2')">set</a>.&nbsp; The default is <b>int</b>.</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#set_base" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">set_base</a></td><td class=SDescription><span class="virtual">virtual</span> Defines the core functionality of a <a href="cl_set-svh.html#set" class=LClass id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">set</a>.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#set_base.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#set_base.equals" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">equals</a></td><td class=SDescription><span class="virtual">virtual</span> Returns 1 if the given collection equals this set.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#set_base.remove_all" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">remove_all</a></td><td class=SDescription><span class="virtual">virtual</span> Removes the elements in the given collection from this set.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="set_base.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="set_base.equals"></a>equals</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit equals(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns 1 if the given collection equals this set.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>c</td><td class=CDLDescription>A collection to compare with.</td></tr></table><h4 class=CHeading>Returns</h4><p>If the given collection is this set, returns 1.&nbsp; If the size of the given collection is not the same as the size of this set, returns 0.&nbsp; If the sizes are the same and this set contains all the elements in the given collection, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">set#(int) int_set0 = new();
set#(int) int_set1 = new();

void'( int_set0.add( 123 ) );
void'( int_set1.add( 123 ) );
assert( int_set0.equals( int_set1 ) == 1 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="set_base.remove_all"></a>remove_all</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove_all(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes the elements in the given collection from this set.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>c</td><td class=CDLDescription>A collection containing elements to be removed from this set.</td></tr></table><h4 class=CHeading>Returns</h4><p>If this set changed as a result of the call, 1 is returned.&nbsp;  Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">set#(int) int_set0 = new();
set#(int) int_set1 = new();

void'( int_set0.add( 123 ) );
void'( int_set0.add( 456 ) );
void'( int_set1.add( 123 ) );
assert( int_set0.remove_all( int_set1 ) == 1 );</pre></blockquote></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual class set_base #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends collection#( T )</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Defines the core functionality of a set.</div></div><div class=CToolTip id="tt2"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class set #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends set_base#( T )</td></tr></table></td></tr></table></blockquote>Implements the set_base using an associative array.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit equals(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns 1 if the given collection equals this set.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit remove_all(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Removes the elements in the given collection from this set.</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>